#pragma once

#include <Windows.h>
#include <d3d11.h>
#include <DirectXMath.h>
#include "AlignedAllocationPolicy.h"

class CheckersApp;

class CheckersBoard : public AlignedAllocationPolicy<16>
{
	// Constants
	static const DirectX::XMFLOAT3 BLACK_COLOR;
	static const DirectX::XMFLOAT3 WHITE_COLOR;

	// Fields
	CheckersApp *app;
	char highlight[8][8];
	DirectX::XMFLOAT3 highlightColors[16];
	DirectX::XMMATRIX worldMatrix;

public:

	// Constructor/Destructor
	CheckersBoard(CheckersApp *app);
	~CheckersBoard();

	// Methods
	void ClearHighlights() { memset(highlight, -1, sizeof(highlight)); }
	void Draw();
	void Highlight(int i, int j, char colorIndex) { highlight[i][j] = colorIndex; }

	// Getters
	DirectX::XMMATRIX WorldMatrix() const { return worldMatrix; }

	// Setters
	void SetHighlightColor(int colorIndex, const DirectX::XMFLOAT3 &color) { highlightColors[colorIndex] = color; }
	void SetWorldMatrix(const DirectX::XMMATRIX &worldMatrix) { this->worldMatrix = worldMatrix; }
};